package JavaBase.Polymorphism;

public class Calculator_Test {
    public static void main(String[] args) {
        Calculator calculator;
        calculator=new Plus(10,2);
        if(calculator instanceof Plus)
        {
            Plus plus=(Plus)calculator;
            plus.count();
        }
        calculator=new Sub(10,2);
        if(calculator instanceof Sub)
        {
            Sub sub=(Sub)calculator;
            sub.count();
        }
        calculator=new Mul(10,2);
        if(calculator instanceof Mul)
        {
            Mul mul=(Mul)calculator;
            mul.count();
        }
        calculator=new Div(10,2);
        if(calculator instanceof Div)
        {
            Div div=(Div)calculator;
            div.count();
        }
    }
}
